<?php

class Registermodel extends CI_Model{

	private $conturi = "conturi";

	function exista($email){

		$data = array('email' => $email);
		$this->db->where($data); 
		$query = $this->db->get($this->conturi);
		if($query->num_rows() == 0){
			return FALSE;
		}else{
			return TRUE;
		}
	}
	function insereaza($parola, $nume, $prenume, $email){
	//	$parola = md5($parola);
		$data = array(
			'nume' => $nume,
			'prenume' => $prenume,
			'pass' => $parola,
			'email' => $email,	
			'data_n' => date('d.m.Y'),					
			'activ' => 1,
		);
		$this->db->insert($this->conturi, $data);
	}
}
?>